//
//  MyAction.m
//  JinFuThree
//
//  Created by 爱尚 on 2018/8/29.
//  Copyright © 2018年 毛韶谦. All rights reserved.
//

#import "MyAction.h"
#import "MyViewController.h"
#import "MyMessageVC.h"
#import "AdvancedApproveVC.h"
#import "AddBankCardVC.h"
#import "MyLoansVC.h"
#import "InstamentMyVC.h"
#import "MyActionWithInformation.h"

@implementation MyAction

- (UIViewController *)mainViewController {
    MyViewController *myVC = [[MyViewController alloc]init];
    return myVC;
}

- (UIViewController *)my_MessageViewController {
    
    MyMessageVC *vc = [[MyMessageVC alloc] init];
    return vc;
}

- (UIViewController *)my_AddBankCardViewController {
    
    AddBankCardVC *vc = [[AddBankCardVC alloc] init];
    return vc;
}

//放款页面
- (UIViewController *)my_LoansViewController {
    
    MyLoansVC *vc = [[MyLoansVC alloc] init];
    return vc;
}
//分期页面
- (UIViewController *)my_InstamentViewController {
    
    InstamentMyVC *vc = [[InstamentMyVC alloc] init];
    return vc;
}


/**
 高级实名认证VC

 @return VC
 */
- (UIViewController *)my_AdvancedApproveViewController {
    
    AdvancedApproveVC *vc = [[AdvancedApproveVC alloc] init];
    return vc;
}


/**
 是否有新消息

 @return 1 有
 */
- (id)my_HaveNewMessage {
    
    NSString *message = [AD_UserDefaults objectForKey:@"setMessageNoread"];
    if ([message isEqualToString:@"1"]) {
        return @1;
    }else {
        return @0;
    }
}


/**
 清空消息红点 进入消息页面时使用
 */
- (void)emptyNewMessage {
    
    [AD_UserDefaults setObject:@"0" forKey:@"setMessageNoread"];
    [AD_UserDefaults synchronize];
}





-(id)getMessageStatusWithApplicationFinishLaunchingWithOptionsDataDict:(NSDictionary *)dataDict
{
    UIApplication * application = dataDict[@"Application"];
    NSDictionary * options = dataDict[@"options"];
    MyActionWithInformation * mannager = [MyActionWithInformation mananger];
    [mannager getMessageStatusWithApplication:application didFinishLaunchingWithOptions:options];
    return nil;
}
-(id)getMessgaeWhthApplicationDidBecomeActiveWithDataDict:(NSDictionary *)dataDict
{
    UIApplication * application = dataDict[@"Application"];
    MyActionWithInformation * mannager = [MyActionWithInformation mananger];
    [mannager getMessgaeWhthApplicationDidBecomeActive:application];
    return nil;
}
-(id)getMessageWhenApplicationWillEnterForegroundWithDataDict:(NSDictionary *)dataDict
{
    UIApplication * application = dataDict[@"Application"];
    MyActionWithInformation * mannager = [MyActionWithInformation mananger];
    [mannager getMessageWhenApplicationWillEnterForeground:application];
    return nil;
}
-(id)getMessageNumWhenApplicationReceiveRemoteNotificationWithDataDict:(NSDictionary *)dataDict
{
    UIApplication * application = dataDict[@"Application"];
    NSDictionary * options = dataDict[@"options"];
    UIWindow * window = dataDict[@"window"];
    MyActionWithInformation * manager = [MyActionWithInformation mananger];
    [manager getMessageNumWhenApplication:application didReceiveRemoteNotification:options window:window];
    return nil;
}



@end
